<template>
  <div class="app">
    <h2>我有台车：{{ car }}</h2>
    <Child :car="car" :updateCar="updateCar"/>
  </div>
</template>

<script>
  import Child from './components/Child.vue'

  export default {
    name:'App',
    components:{Child},
    data() {
      return {
        car:'奔驰'
      }
    },
    methods: {
      updateCar(value){
        this.car = value
      }
    },
  }
</script>

<style scoped>
  .app {
    background-color: #ddd;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 0 10px;
  }
</style>

